'''
models（模型）:用于配置数据库中表的构成（对表中对象的类的构建）
'''

from exts import  db
from datetime import datetime

class UserModel(db.Model):
    __tablename__ = "user"
    id = db.Column(db.Integer,primary_key= True,autoincrement = True)
    username = db.Column(db.String(100),nullable = False)
    password = db.Column(db.String(200),nullable = False)
    email = db.Column(db.String(100),nullable = False,unique = True)
    join_time = db.Column(db.DateTime,default = datetime.now)

class EmailCaptchaModel(db.Model):
    __tablename__ = "email_captcha"
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    email = db.Column(db.String(100), nullable=False)
    captcha = db.Column(db.String(100), nullable=False)

class AtitudeDataModel(db.Model):
    __tablename__ = "AtitudeData"
    id = db.Column(db.Integer, primary_key=True, autoincrement=True)
    roll = db.Column(db.String(100),nullable=False)
    pitch = db.Column(db.String(100),nullable=False)
    yaw = db.Column(db.String(100),nullable=False)
    join_time = db.Column(db.DateTime,default = datetime.now)


class Fake_g_Model():
    fake_g_name ="fake"
    fake_data = 666
